package org.mpremote.android.activities.abstracts;

import android.app.Activity;
import android.content.SharedPreferences;
import org.mpremote.android.R;

/**
 * Created by IntelliJ IDEA.
 * User: Gilad
 * Date: 31/08/2010
 * Time: 21:29:31
 */
public class MPActivity extends Activity {

    protected SharedPreferences getProperties() {
        return getSharedPreferences(getString(R.string.mp_properties_preferences_file), 0);
    }

    protected SharedPreferences.Editor getPropertiesEditor() {
        return getProperties().edit();
    }

    protected String getProperty(String key) {
        return getProperty(key, null);
    }

    protected String getProperty(int key) {
        return getProperty(key, null);
    }

    protected String getProperty(String key, String defaultValue) {
        return getProperties().getString(key, defaultValue);
    }

    protected String getProperty(int key, int defaultValue) {
        return getProperties().getString(getString(key), getString(defaultValue));
    }

    protected String getProperty(int key, String defaultValue) {
        return getProperties().getString(getString(key), defaultValue);
    }


}
